package com.duyutian.controller.manageController;

import com.duyutian.model.ArticleCategory;
import com.jfinal.json.JFinalJson;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by dyt on 2018/9/27.
 */
/*控制页面中间的动态跳转*/
@Controller
public class skipController {

    @RequestMapping("/cms/toSkip")
    public String toSkip(String path) {
        return "cms/" + path;
    }

    @RequestMapping("/cms/index")
    public String index(Model model) {
        return "cms/index";
    }

    @RequestMapping("/test")
    @ResponseBody
    public String test(){
        return JFinalJson.getJson().toJson(ArticleCategory.dao.find("select * from article_category"));
    }
    @RequestMapping("/test1")
    public String test1(){
        return "test";
    }

}
